package org.huntaway.po.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the rolemenu table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="rolemenu"
 */

public abstract class BaseRolemenu  implements Serializable {

	public static String REF = "Rolemenu";
	public static String PROP_MENU = "Menu";
	public static String PROP_PARENT_ID = "ParentId";
	public static String PROP_ROLE = "Role";
	public static String PROP_MENU_ORDER = "MenuOrder";
	public static String PROP_FUNC = "Func";
	public static String PROP_ID = "Id";


	// constructors
	public BaseRolemenu () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseRolemenu (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseRolemenu (
		java.lang.Integer id,
		org.huntaway.po.Sysmenu menu) {

		this.setId(id);
		this.setMenu(menu);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String func;
	private java.lang.Integer parentId;
	private java.lang.Integer menuOrder;

	// many to one
	private org.huntaway.po.Sysmenu menu;
	private org.huntaway.po.Sysrole role;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="native"
     *  column="id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: func
	 */
	public java.lang.String getFunc () {
		return func;
	}

	/**
	 * Set the value related to the column: func
	 * @param func the func value
	 */
	public void setFunc (java.lang.String func) {
		this.func = func;
	}



	/**
	 * Return the value associated with the column: parent_id
	 */
	public java.lang.Integer getParentId () {
		return parentId;
	}

	/**
	 * Set the value related to the column: parent_id
	 * @param parentId the parent_id value
	 */
	public void setParentId (java.lang.Integer parentId) {
		this.parentId = parentId;
	}



	/**
	 * Return the value associated with the column: menu_order
	 */
	public java.lang.Integer getMenuOrder () {
		return menuOrder;
	}

	/**
	 * Set the value related to the column: menu_order
	 * @param menuOrder the menu_order value
	 */
	public void setMenuOrder (java.lang.Integer menuOrder) {
		this.menuOrder = menuOrder;
	}



	/**
	 * Return the value associated with the column: menu_id
	 */
	public org.huntaway.po.Sysmenu getMenu () {
		return menu;
	}

	/**
	 * Set the value related to the column: menu_id
	 * @param menu the menu_id value
	 */
	public void setMenu (org.huntaway.po.Sysmenu menu) {
		this.menu = menu;
	}



	/**
	 * Return the value associated with the column: role_id
	 */
	public org.huntaway.po.Sysrole getRole () {
		return role;
	}

	/**
	 * Set the value related to the column: role_id
	 * @param role the role_id value
	 */
	public void setRole (org.huntaway.po.Sysrole role) {
		this.role = role;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof org.huntaway.po.Rolemenu)) return false;
		else {
			org.huntaway.po.Rolemenu rolemenu = (org.huntaway.po.Rolemenu) obj;
			if (null == this.getId() || null == rolemenu.getId()) return false;
			else return (this.getId().equals(rolemenu.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}